package com.chanyachting.emall.action.companyproduct;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Companyproduct;
import com.chanyachting.emall.service.CompanyproductService;
import com.chanyachting.emall.serviceImpl.CompanyproductServiceImpl;
import com.chanyachting.emall.util.RequestUtil;

public class RefreshAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		RequestUtil ru=new RequestUtil(request);
		
		int cpid=Integer.parseInt(ru.getParameter("cpid", "0"));

		Companyproduct cp=new Companyproduct();
		
		cp.setId(cpid);

		CompanyproductService cps=new CompanyproductServiceImpl();
		
		cp=cps.getOneCompanyproduct(cp);
		
		boolean temp=cps.refreshCompanyproduct(cp);
		
		return mapping.findForward("nomalProductList");
	}
	
	
	

}
